﻿CREATE TABLE [dbo].[Thing]
(
	[ThingID] BIGINT IDENTITY(1,1) NOT NULL CONSTRAINT [dbo_Thing_ThingID] PRIMARY KEY,
	[ID] NVARCHAR(100) NOT NULL, 
	[FullName] VARCHAR(100) NOT NULL,
	[ThingType] NVARCHAR(10) NOT NULL CONSTRAINT [FK_Thing_TO_ThingType_ON_Enum] FOREIGN KEY ([Thingtype]) REFERENCES [dbo].[ThingType]([Enum]),
	[CreatedBy] NVARCHAR(250) NOT NULL CONSTRAINT [dbo_Thing_CreatedBy] DEFAULT SYSTEM_USER,	
	[DateCreated] DATETIME NOT NULL CONSTRAINT [dbo_Thing_DateCreated] DEFAULT GETDATE(), 
	[DateDeleted] DATETIME NULL,
	[VersionUser] NVARCHAR(250) NOT NULL CONSTRAINT [dbo_Thing_VersionUser] DEFAULT SYSTEM_USER,
	[VersionDate] DATETIME NOT NULL CONSTRAINT [dbo_Thing_VersionDate] DEFAULT GETDATE()
)
